/* login请求
 * login.js
 */

import {REQUEST_URL} from './Constants';
import {postFormData} from './HttpUtil';

//http://xiaoweimeng.com/index.php/api/login/login/email/test@qq.com/password/123456

export function login(loginData={email:'test@qq.com',password:'123456',verifyCode:''},callback=null){
	return postFormData(REQUEST_URL.LOGIN_URL,loginData)
	.then(res=>{
		if(res.success&&callback){
			callback();
		}
	})
	.catch(e=>{
		console.log('login error');
		console.log(e);
	});
	
}

